<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title><#if entity.jqcbId??>编辑<#else>新增</#if>爱车服务商品</title>
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-fileinput/js/fileinput.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-fileinput/js/locals/zh.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-fileinput/css/fileinput.min.css" />


    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/js/bootstrapValidator.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/lang/zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-validator-0.5.3/css/bootstrapValidator.min.css" />


    <style type="text/css">
        .list-path {
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;
        }

        .table-class {
            width: 90%;
            text-align: center;
            border: 1px solid #afd9ee;
            margin: 0 auto;
            margin-top: 50px;
        }

        table th {
            width: 20%;
            background-color: #d9edf7;
            text-align: right;
        }

        table td {
            width: 20%;
            text-align: left;
        }


    </style>
    <script type="text/javascript">

        $(function(){
            //初始化

                $('#picPath').fileinput({
                    language: 'zh', //设置语言
                    allowedFileExtensions : ['jpg', 'png','gif'],//接收的文件后缀
                    showUpload: false, //是否显示上传按钮
                    showCaption: false,//是否显示标题
                    browseClass: "btn btn-primary", //按钮样式
                    previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
                });









            $('#czjjqcbForm').bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {





                    
                title:{
                    message: '输入标题出错',
                    validators:{
                        notEmpty: {
                            message: '标题不能为空'
                        },
                        stringLength:{
                            max: 10,
                            message: '标题不能超过 10个字符'
                        }
                    }
                }

                    ,
                content:{
                    message: '输入内容出错',
                    validators:{
                        notEmpty: {
                            message: '内容不能为空'
                        },
                        stringLength:{
                            max: 100,
                            message: '内容不能超过 100个字符'
                        }
                    }
                }

                    ,
                url:{
                    message: '输入外链接出错',
                    validators:{
                        notEmpty: {
                            message: '外链接不能为空'
                        },
                        stringLength:{
                            max: 1000,
                            message: '外链接不能超过 1000个字符'
                        }
                    }
                }

                    ,
                orderby:{
                    message: '输入序号出错',
                    validators:{
                        notEmpty: {
                            message: '序号不能为空'
                        },
                        stringLength:{
                            max: 1,
                            message: '序号不能超过 1个字符'
                        },
                        regexp: {
                            regexp: /^[0-9]+$/,
                                    message:'序号只能是数字'
                        }
                    }
                }

                    ,
                originalPrice:{
                        message: '输入原价出错',
                        validators:{
                            notEmpty: {
                                message: '原价不能为空'
                            },
                            stringLength:{
                                max: 11,
                                message: '原价不能超过 11个字符'
                            },
                            regexp: {
                                regexp: /^[1-9][0-9]*$|^[1-9][0-9]*\.[0-9]{1,2}$|^0\.[0-9]{1,2}$/,
                                message:'原价只能是金额'
                            }
                        }
                    }


                    ,
                presentPrice:{
                        message: '输入现价出错',
                        validators:{
                            notEmpty: {
                                message: '现价不能为空'
                            },
                            stringLength:{
                                max: 11,
                                message: '现价不能超过 11个字符'
                            },
                            regexp: {
                                regexp: /^[1-9][0-9]*$|^[1-9][0-9]*\.[0-9]{1,2}$|^0\.[0-9]{1,2}$/,
                                message:'现价只能是金额'
                            }
                        }
                    }

                }
            });


        });

    </script>
</head>
<body>

<#include "/view/admin/listnav.html"/>


<div class="table-class">
    <#include "/view/admin/opermsg.html"/>
    <form id="czjjqcbForm" action="${base}/czjjqcb/save.do"
     method="post" enctype="multipart/form-data"  >
    <table class="table table-bordered">

                        <input type="hidden" style="display: none" name="jqcbId" value="${entity.jqcbId!}"/>


                <tr>
                <th>图片</th>
                <td>
            <#if entity.picPath??>
                        <img src="${base}${entity.picPath!}" height="100px">
            </#if>

                    <input type="file" class="form-control" id="picPath" name="filePicPath" >
                </td>
                

                
                <th>标题</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="title" name="title" placeholder="请输入标题" value="${entity.title!}">
                    </div>
                </td>
                </tr>

                <tr>
                <th>内容</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="content" name="content" placeholder="请输入内容" value="${entity.content!}">
                    </div>
                </td>
                

                
                <th>图片跳转链接</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="url" name="url" placeholder="例如：http://www.baidu.com" value="${entity.url!}">
                    </div>
                </td>
                </tr>

                <tr>
                <th>顺序</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="orderby" name="orderby" placeholder="请输入顺序" value="${entity.orderby!}">
                    </div>
                </td>
                

                
                <th>原价</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="originalPrice" name="originalPrice" placeholder="请输入原价" value="${entity.originalPrice!}">
                    </div>
                </td>
                </tr>

                <tr>
                <th>现价</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="presentPrice" name="presentPrice" placeholder="请输入现价" value="${entity.presentPrice!}">
                    </div>
                </td>
                </tr>


        <tr>
            <td colspan="4" width="100%" style="text-align: center;">
                <input type="submit" class="btn btn-success " value="保存"/>
                <span style="width: 20px;">&nbsp;</span>
                <a class="btn btn-danger " href="javascript:window.history.go(-1)">
                   </span>返回</a>
            </td>
        </tr>

    </table>
</form>




</div>

<script type="text/javascript">

</script>


</body>
</html>
